//写接口函数的

import request from '@/utils/request'
import type { TradeMarkListDataModel,TradeMarkModel} from '../model/trademarkModel'

// 枚举
enum Api{
  // 获取品牌列表
  getTrademarkListApi='/admin/product/baseTrademark',
  // 添加品牌
  saveTrademarkInfoApi= '/admin/product/baseTrademark/save',
  // 删除品牌
  removeTrademarkInfoApi = '/admin/product/baseTrademark/remove',
  //编辑修改品牌
  updateTrademarkInfoApi = '/admin/product/baseTrademark/update'
}

//获取品牌列表数据
export const reqGetTradeMarkList = (page:number,limit:number)=>{
  return request.get<any,TradeMarkListDataModel>(`/admin/product/baseTrademark/${page}/${limit}`)
}

//新增品牌  
export const reqSaveTrademarkInfo = (trademarkInfo:TradeMarkModel) => {
  return request.post(Api.saveTrademarkInfoApi,trademarkInfo)
}

//删除品牌
export const reqRemoveTrademarkInfo = (id: number) => request.delete(Api.removeTrademarkInfoApi + `/${id}`)


//编辑修改品牌
export const reqUpdateTrademarkInfo = (trademarkInfo: TradeMarkModel) => request.put(Api.updateTrademarkInfoApi, trademarkInfo)
